package com.dg.cuckoo.admin.repository;

import com.dg.cuckoo.admin.dto.basicInformation.projectInformation.BasicProjectDto;
import com.dg.cuckoo.admin.dto.projectInfo.ProjectLogDto;
import com.dg.cuckoo.core.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProjectLogRepository extends BaseRepository<ProjectLogDto,String> {

    List<ProjectLogDto> findByProjectId(String projectId);

    @Query(value = "select * from project_log where type=? limit ?,?",nativeQuery = true)
    List<ProjectLogDto> page(Integer type,Integer page, Integer pageSize);

    @Query(value = "select * from project_log where type=? and project_id=? limit ?,?",nativeQuery = true)
    List<ProjectLogDto> logPage(Integer type,String projectId,Integer page, Integer pageSize);

}
